import pytest
import time


class TestTime(object):
    """测试类"""
    def setup_class(self):
        print("开始时间", time.time())
        # time.sleep(1)  # 等待1秒钟

    def teardown_class(self):
        print("结束时间", time.time())

    def test01(self):
        print("test01")

    def test02(self):
        print("test02")


if __name__ == '__main__':
    # pytest.main(["-s", "hm03_setup_class和teardown_class应用.py"])
    # 指定执行某条测试用例
    pytest.main(["-s", "hm03_setup_class和teardown_class应用.py::TestTime::test01"])
